package com.djk.mapper;

import com.djk.pojo.SysUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SysUserMapper {
    /**
     * 按照用户名查找
     * @param username
     * @return
     */
    @Select("select * from sys_user where username=#{username}")
    SysUser findByName(String username);

    //添加一个用户
    @Insert("insert into sys_user(username, user_pwd) values (#{username},#{userPwd})")
    void add(SysUser sysUser);

    @Select("select * from sys_user where username=#{username} and user_pwd=#{userPwd}")
    SysUser findByNameAndPwd(SysUser sysUser);
}
